package com.smartaccounting.model;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class Expense {
    private int expenseId;
    private int userId;
    private BigDecimal amount;
    private String category;
    private String paymentMethod;
    private LocalDate expenseDate;
    private String description;
    private LocalDateTime createdAt;

    // 无参构造方法
    public Expense() {}

    // 全参构造方法
    public Expense(int expenseId, int userId, BigDecimal amount, String category,
                   String paymentMethod, LocalDate expenseDate, String description,
                   LocalDateTime createdAt) {
        this.expenseId = expenseId;
        this.userId = userId;
        this.amount = amount;
        this.category = category;
        this.paymentMethod = paymentMethod;
        this.expenseDate = expenseDate;
        this.description = description;
        this.createdAt = createdAt;
    }

    // 添加支出用构造方法
    public Expense(int userId, BigDecimal amount, String category,
                   String paymentMethod, LocalDate expenseDate, String description) {
        this.userId = userId;
        this.amount = amount;
        this.category = category;
        this.paymentMethod = paymentMethod;
        this.expenseDate = expenseDate;
        this.description = description;
    }

    // Getter 和 Setter 方法
    public int getExpenseId() {
        return expenseId;
    }

    public void setExpenseId(int expenseId) {
        this.expenseId = expenseId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public LocalDate getExpenseDate() {
        return expenseDate;
    }

    public void setExpenseDate(LocalDate expenseDate) {
        this.expenseDate = expenseDate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public String toString() {
        return "Expense{" +
                "expenseId=" + expenseId +
                ", userId=" + userId +
                ", amount=" + amount +
                ", category='" + category + '\'' +
                ", paymentMethod='" + paymentMethod + '\'' +
                ", expenseDate=" + expenseDate +
                ", description='" + description + '\'' +
                '}';
    }
}